package com.bean;

import com.imessage.type.BusinessTaskCmd;
import com.imessage.type.BusinessTaskState;
import com.imessage.type.BusinessTaskType;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;

@Getter
@Setter
@ToString
@Entity
@Table(name = "business_task_detail", schema = "public")
public class BusinessTaskDetail extends BaseModel implements Serializable {

    @ManyToOne
    @JoinColumn(name = "business_task_id")
    private BusinessTask BusinessTask;

    @ManyToOne
    @JoinColumn(name = "device_client_id")
    private DeviceClient DeviceClient;

    @ManyToOne
    @JoinColumn(name = "device_virtual_id")
    private DeviceVirtual DeviceVirtual;

    @ManyToOne
    @JoinColumn(name = "business_apple_id")
    private BusinessApple BusinessApple;

    @ManyToOne
    @JoinColumn(name = "business_wuma_id")
    private BusinessWuma BusinessWuma;

    @Column(name = "cmd", nullable = true, length = 2)
    private BusinessTaskCmd cmd = BusinessTaskCmd.other;

    @Column(name = "name", nullable = true, length = 255)
    private String name;

    @Lob
    @Column(name = "all_phone",nullable = true, columnDefinition="TEXT")
    private String allPhone;

    @Column(name = "wait_phone", nullable = true, columnDefinition="TEXT")
    private String waitPhone;

    @Column(name = "succ_phone", nullable = true, columnDefinition="TEXT")
    private String succPhone;

    @Column(name = "error_phone", nullable = true, columnDefinition="TEXT")
    private String errorPhone;

    @Column(name = "img_addr", nullable = true, length = 255)
    private String imgAddr;

    @Column(name = "msg", nullable = true, length = 500)
    private String msg;

    @Column(name = "type", nullable = true, length = 2)
    private BusinessTaskType type = BusinessTaskType.other;

    @Column(name = "username", nullable = true, length = 255)
    private String username;

    @Column(name = "passwd", nullable = true, length = 255)
    private String passwd;

    @Column(name = "zip_file_name", nullable = true, length = 255)
    private String zipFileName;

    @Column(name = "down_file_addr", nullable = true, length = 255)
    private String downFileAddr;

    @Column(name = "upload_file_addr", nullable = true, length = 255)
    private String uploadFileAddr;

    @Column(name = "state", nullable = true, length = 2)
    private BusinessTaskState state = BusinessTaskState.wait;



}
